<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <script src="../js/jquery-3.4.1.min.js"></script>
        <style>
            div{
                width:100px;
                height: 100px;
                border:1px solid red;
            }
        </style>
        <script>

            // jQuery对象.animate(对象,毫秒,函数);1000毫秒执行完后执行函数
            $(function(){
                $("#btn").click(function () {
                    $("div").animate({
                        "width":"300px",
                        "height":"300px"
                    },2000,function(){
                        $("div").animate({
                            "width":"400px",
                            "height":"500px"
                        },2000,function(){
                            $("div").animate({
                                "width":"0px",
                                "height":"0px"
                            },2000,function(){
                                alert("动画执行成功");
                            })
                        });
                    });
                });
            });
        </script>
    </head>
    <body>
        <input type="button" value="自定义动画" id="btn">
        <div id="mydiv"></div>
    </body>
</html>